package com.ruoyi.util;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.app.entity.AppAccess;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;

/**
 * 描述:
 *
 * @author chenconghua
 * @version 1.0
 * @create 2022-10-31 10:19 PM
 */
public  class GetAccessUtil {

    public static QueryWrapper<AppAccess> getAppAccessQueryWrapper(Integer appId, String url) {
        AppAccess appAccess =new AppAccess();
        appAccess.setAppId(appId);
        appAccess.setVisitUrl(url);
        QueryWrapper<AppAccess> queryWrapper =new QueryWrapper<>();
        queryWrapper.eq("app_id",appId).eq("visit_url","/app/user/api/register");
        return queryWrapper;
    }
    public static AppAccess getAppAccess(Integer appId, String url) {
        AppAccess appAccess= new AppAccess();
        appAccess.setAppId(appId);
        appAccess.setVisitUrl(url);
        appAccess.setUpdateTime(new Date());
        return appAccess;
    }
}
